<template>
  <view class="container-share">
    <h2>分享至</h2>
    <view class="share-list">
      <view class="list-item" @click="handleShare('wechat')">
        <view class="item-icon"><uni-icons size="30" color="#fff" type="weixin"></uni-icons></view>
        <span>微信好友</span>
      </view>
      <view class="list-item" @click="handleShare('wechatmoments')">
        <view class="item-icon"><uni-icons size="30" color="#fff" type="pyq"></uni-icons></view>
        <span>朋友圈</span>
      </view>
      <view class="list-item" @click="handleShare('qq')">
        <view class="item-icon"><uni-icons size="30" color="#fff" type="qq"></uni-icons></view>
        <span>QQ好友</span>
      </view>
    </view>
    <button @click="handleCancel" class="share-cancel">取消</button>
  </view>
</template>

<script>
  export default {
    name:"share",
    data() {
      return {
        
      };
    },
    methods:{
      handleCancel(){  //  点击取消
        this.$emit('on-close')
      },
      handleShare(e){  ///  点击了分享
        this.$emit('on-share',e)
      }
    }
  }
</script>

<style lang="less" scoped>
.container-share{
  background: #fff;
  padding: 10rpx 40rpx 0;
  h2{
    font-size: 28rpx;
    text-align: center;
    font-weight: 400;
    color: #666;
  }
  .share-list{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 30rpx 40rpx;
    font-size: 24rpx;
    .list-item{
      display: flex;
      flex-direction: column;
      text-align: center;
      .item-icon{
        width: 90rpx;
        height: 90rpx;
        line-height: 90rpx;
        margin-bottom: 8rpx;
        border-radius: 50%;
        background: #69c654;
      }
    }
  }
  .share-cancel{
    line-height: 90rpx;
    background-color: #fff;
    font-size: 32rpx;
    border-top: .3px solid #eee;
  }
}
</style>